package com.example.administrator.myapplication.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import java.util.Map;
import java.util.Timer;

/**
 * Created by Administrator on 2016/6/30.
 */
public class MyServerce extends Service {
    private static MyServerce INSTANCE = null;
    private Map<String, Object> pusMap = null;
    public String pushChannelId = "";
    private String pushUserId = "";
    private Boolean isSubLocation = false;
    private Map<String, Object> lbsMap;
    private Timer timer;
    public static MyServerce getInstance() {
        if (INSTANCE != null) {
            return INSTANCE;
        }
        return null;
    }

    @Override
    public IBinder onBind(Intent arg0) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public void onCreate() {
        // TODO Auto-generated method stub
        super.onCreate();
        if (INSTANCE == null) {
            INSTANCE = this;
        }
    }

    @Override
    public void onDestroy() {
        // TODO Auto-generated method stub
        super.onDestroy();
        if (INSTANCE != null) {
            INSTANCE = null;
        }
    }

    @Override
    @Deprecated
    public void onStart(Intent intent, int startId) {
        // TODO Auto-generated method stub
        super.onStart(intent, startId);
    }

    public void stopSubmmitLocation(){
        if(timer!=null){
            timer.cancel();
        }
        isSubLocation=false;
    }
}
